import request from '@/utils/request'

export function searchProject(userId, searchObj, pageNum, pageSize) {
  return request({
    url: '/project/myReport/myProjectSearch',
    method: 'post',
    data: searchObj,
    params: { userId, pageNum, pageSize }
  })
}
export function searchAllProject(searchObj, pageNum, pageSize) {
  return request({
    url: '/project/projectCommon/searchAllProject',
    method: 'post',
    data: searchObj,
    params: { pageNum, pageSize }
  })
}
export function searchArchivesProject(searchObj, pageNum, pageSize) {
  return request({
    url: '/project/archives/searchArchivesProject',
    method: 'post',
    data: searchObj,
    params: { pageNum, pageSize }
  })
}
export function searchAuditProject(searchObj, userId, pageNum, pageSize) {
  return request({
    url: '/project/audit/searchAuditProject',
    method: 'post',
    data: searchObj,
    params: { userId, pageNum, pageSize }
  })
}
export function searchAlreadyProject(searchObj, userId, pageNum, pageSize) {
  return request({
    url: '/project/audit/searchAlreadyProject',
    method: 'post',
    data: searchObj,
    params: { userId, pageNum, pageSize }
  })
}
export function searchEnquiryProject(searchObj, pageNum, pageSize) {
  return request({
    url: '/project/enquiry/searchEnquiryProject',
    method: 'post',
    data: searchObj,
    params: { pageNum, pageSize }
  })
}
export function searchFinanceProject(searchObj, pageNum, pageSize) {
  return request({
    url: '/project/finance/searchFinanceProject',
    method: 'post',
    data: searchObj,
    params: { pageNum, pageSize }
  })
}
export function searchStatisticsProject(searchObj, pageNum, pageSize) {
  return request({
    url: '/project/statistics/searchStatisticsProject',
    method: 'post',
    data: searchObj,
    params: { pageNum, pageSize }
  })
}
export function getProjectInfo(id) {
  return request({
    url: '/project/common/getProject/' + id,
    method: 'get'
  })
}
export function getProjectStatus(id) {
  return request({
    url: '/project/common/getStatus/' + id,
    method: 'get'
  })
}
export function updateProject(project) {
  return request({
    url: '/project/common/updateProject/',
    method: 'post',
    data: project
  })
}
export function updateProjectLeaf(reportLeaf, statusNum) {
  return request({
    url: '/project/common/updateProjectLeaf/' + statusNum,
    method: 'put',
    data: reportLeaf
  })
}
export function submitAudit(reportId, userId) {
  return request({
    url: '/project/common/submitAudit',
    method: 'get',
    params: { reportId, userId }
  })
}
export function auditPassProject(reportId, userId) {
  return request({
    url: '/project/common/auditPassProject',
    method: 'get',
    params: { reportId, userId }
  })
}
export function stampAudit(reportId, userId) {
  return request({
    url: '/project/common/stampAudit',
    method: 'get',
    params: { reportId, userId }
  })
}
export function auditToFile(reportId, userId) {
  return request({
    url: '/project/common/file',
    method: 'get',
    params: { reportId, userId }
  })
}
export function backReportLeaf(reportLeaf) {
  return request({
    url: '/project/common/backReportLeaf/',
    method: 'post',
    data: reportLeaf
  })
}
export function addInitProject(project) {
  return request({
    url: '/project/addInit/addInitProject',
    method: 'post',
    data: project
  })
}
export function auditProjectList(id, pageNum, pageSize) {
  return request({
    url: '/project/audit/auditProjectList/' + id,
    method: 'get',
    params: { pageNum, pageSize }
  })
}
export function downloadFinance(searchObj) {
  return request({
    url: '/project/statistics/download',
    method: 'post',
    data: searchObj,
    responseType: 'blob'
  })
}
export function getSearchFormList() {
  return request({
    url: '/project/myReport/getSearchForm',
    method: 'get'
  })
}
